package com.example.demo.Logger;

public class FacadeDemo {
    public static void main(String[] args) {
        FacadeLight facadeLight = new FacadeLight();
        facadeLight.lightOn();
        facadeLight.lightOff();
    }
}

class FacadeLight{

    private Light livingRoomLight = new LivingRoomLight();
    private Light hallLight= new HallLight();
    private Light diningRoomLight= new DiningRoomLight();

    public void lightOn(){
        livingRoomLight.lightOn();
        hallLight.lightOn();
        diningRoomLight.lightOn();
    }

    public void lightOff(){
        livingRoomLight.lightOff();
        hallLight.lightOff();
        diningRoomLight.lightOff();
    }

}

interface Light{
    void lightOn();//开灯
    void lightOff();//关灯
}

//客厅灯
class LivingRoomLight implements Light{

    @Override
    public void lightOn() {
        System.out.println("打开客厅灯...");
    }

    @Override
    public void lightOff() {
        System.out.println("关闭客厅灯..");
    }
}

//餐厅灯
class DiningRoomLight implements Light{

    @Override
    public void lightOn() {
        System.out.println("打开餐厅灯...");
    }

    @Override
    public void lightOff() {
        System.out.println("关闭餐厅灯..");
    }
}

//走廊灯
class HallLight implements Light{

    @Override
    public void lightOn() {
        System.out.println("打开走廊灯...");
    }

    @Override
    public void lightOff() {
        System.out.println("关闭走廊灯..");
    }
}